package com.groupbuying.sysconfig.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.groupbuying.sysconfig.dao.SysconfigFunctionControlDao;
import com.groupbuying.sysconfig.domain.SysconfigFunctionControlDO;
import com.groupbuying.sysconfig.service.SysconfigFunctionControlService;



@Service
public class SysconfigFunctionControlServiceImpl implements SysconfigFunctionControlService {
	@Autowired
	private SysconfigFunctionControlDao sysconfigFunctionControlDao;
	
	@Override
	public SysconfigFunctionControlDO get(Integer id){
		return sysconfigFunctionControlDao.get(id);
	}
	
	@Override
	public List<SysconfigFunctionControlDO> list(Map<String, Object> map){
		return sysconfigFunctionControlDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return sysconfigFunctionControlDao.count(map);
	}
	
	@Override
	public int save(SysconfigFunctionControlDO sysconfigFunctionControl){
		return sysconfigFunctionControlDao.save(sysconfigFunctionControl);
	}
	
	@Override
	public int update(SysconfigFunctionControlDO sysconfigFunctionControl){
		return sysconfigFunctionControlDao.update(sysconfigFunctionControl);
	}
	
	@Override
	public int remove(Integer id){
		return sysconfigFunctionControlDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return sysconfigFunctionControlDao.batchRemove(ids);
	}

	/**
	 * 通过中心名称获取拦截请求路径集合
	 * @param centerCode 中心编码
	 * @return
	 */
	@Override
	public List<String> getUrls(String centerCode) {
		List<String> urls = new ArrayList<>();
		try{
			urls = sysconfigFunctionControlDao.getUrls(centerCode);
		}catch (Exception e){
			e.printStackTrace();
		}
		return urls;
	}

}
